package top.toptimus.dto.accessory;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.dto.order.orderSync.orderCommit.OrderCommitDto;

import java.util.List;
import java.util.Map;

/**
 * 款式下的辅料选择
 *
 * @author gaoyu
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StyleAccessoryItemsDTO {
    private String orderId;
    private String styleName;    //  款式名称
    private Map<String, List<StyleAccessoryDetailDTO>> styleAccessoryDetails;   //  款式下辅料定义 K:辅料项目id。

    /**
     * orderId注入
     *
     * @param orderId 订单id
     * @return StyleAccessoryItemsDTO
     */
    public StyleAccessoryItemsDTO buildOrderId(String orderId) {
        this.orderId = orderId;
        return this;
    }

    public StyleAccessoryItemsDTO(OrderCommitDto orderCommitDto) {
        this.orderId = orderCommitDto.getStyleAccessoryItemsDTO().getOrderId();
        this.styleName = orderCommitDto.getStyleAccessoryItemsDTO().getStyleName();
        this.styleAccessoryDetails = orderCommitDto.getStyleAccessoryItemsDTO().getStyleAccessoryDetails();
    }
}
